package com.niodata.md.rdb.model;

import lombok.Getter;
import lombok.Setter;

/**
 * rdb db server info.
 */
@Getter
@Setter
public class DbInfo {
  private String databaseServerType;
  private String productName;
  private int databaseMajorVersion;
  private int databaseMinorVersion;
  private String productVersion;
  private String driverVersion;
  private String driverName;
  private String host;
  private int port;


  @Override
  public int hashCode() {
    return host.hashCode() & 11 + port + "".hashCode() * 7;
  }

  @Override
  public String toString() {
    return "DbInfo{"
        + "databaseServerType='" + databaseServerType + '\''
        + ", productName='" + productName + '\''
        + ", databaseMajorVersion='" + databaseMajorVersion + '\''
        + ", databaseMinorVersion='" + databaseMinorVersion + '\''
        + ", productVersion='" + productVersion + '\''
        + ", driverVersion='" + driverVersion + '\''
        + ", driverName='" + driverName + '\''
        + ", host='" + host + '\''
        + ", port=" + port
        + '}';
  }
}
